﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Abrs.Model;

namespace Abrs.Services.Rest
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IProductService”。
    [ServiceContract]
    public interface IProductService
    {
        [OperationContract]
        [WebGet(UriTemplate = "Product")]
        List<Product> GetProducts();

        [OperationContract]
        [WebGet(UriTemplate = "Product/{name}/{id}")]
        Product GetProduct(string id, string name);

        [OperationContract]
        [WebInvoke(UriTemplate = "Product", Method = "PUT")]
        bool CreateProduct(Product product);

        [OperationContract]
        [WebInvoke(UriTemplate = "Product", Method = "POST")]
        bool UpDateProduct(Product product);

        [OperationContract]
        [WebInvoke(UriTemplate = "Product", Method = "DELETE")]
        bool DeleteProduct(Product product);
    }
}
